跳台阶 Posted on 2019-08-13 | In 剑指offer | | reads times 跳台阶题目描述 一只青蛙一次可以跳上1级台阶,也可以跳上2级。求该青蛙跳上一个n级的台阶总共有多少种跳法(先后次序不同算不同的结果)。 1234567891011function jumpFloor(number){ // write code here var n1=1; var n2=2; while(--number){ n2+=n1; n1=n2-n1; } return n1;} Post author: GoldMiner Xun Post link: https://goldminerxun.github.io/2019/08/13/%E5%89%91%E6%8C%87offer%20JavaScript%E7%89%88%20(8)/ Copyright Notice: All articles in this blog are licensed under CC BY-NC-SA 3.0 unless stating additionally.